<?php
class Promotion extends MY_Controller
{
    public function __construct() {
        parent::__construct();
        $this->load->model('model_promotion');
    }
    public function index() {
		$data['act'] = 3;
		$data['title'] = "Promotions";
		$data['result'] = $this->model_promotion->getdata(1);
		$data['hotels'] = $this->model_promotion->get_all(1);
		$data['travel'] = $this->model_promotion->get_all(2);
		//$this->debug($data['hotels']);
        $this->load->view('promotion/layout',$data);
    }
    public function detail(){
		$data['act'] = 3;
		$id = $this->uri->segment(2);
		$data['result'] = $this->model_promotion->getdatare($id);
		if($data['result'] == NULL){
			redirect(base_url());
		}
		$data['hotels'] = $this->model_promotion->get_all(1);
		$data['travel'] = $this->model_promotion->get_all(2);
		$data['title'] = "Promotions - ".$data['result']['promo_title'];
		//$this->debug($data['result']);
        $this->load->view('promotion/detail/layout',$data);
    }
}
?>